A phase-locked loop (PLL) circuit is a feedback system that generates an output signal whose phase is constant relative to the phase of an input reference signal. In addition to synchronizing signals, a phase-locked loop can generate a frequency that is a multiple of the input frequency.
For example, shown in FIG. 1 is a typical PLL circuit 100. The PLL 100 includes a phase detector (PFD) 102, charge pump 104, loop filter 106, and VCO 108. The phase detector 102 compares the input signal and a feedback signal. The PFD 102 detects the difference in phase and frequency between the reference signal Fref and a feedback signal and generates an “up” U or “down” D control signal based on whether the feedback frequency is lagging or leading the reference frequency. These “up” or “down” control signals determine whether the VCO 108 needs to operate at a higher or lower frequency, respectively.
The PFD 102 outputs these “up” and “down” signals to the charge pump 104. If the charge pump 104 receives an up signal, current is driven into the loop filter 106. Conversely, if it receives a down signal, current is drawn from the loop filter 106.
The loop filter 106 converts these signals to a control voltage that is used to bias the VCO 108. Based on the control voltage, the VCO 108 oscillates at a higher or lower frequency, which affects the phase and frequency of the feedback clock. If the PFD 102 produces an up signal, then the VCO frequency increases. A down signal decreases the VCO frequency. The VCO 108 stabilizes once the reference clock and the feedback clock have the same phase and frequency. The loop filter 106 filters out jitter by removing glitches from the charge pump and preventing voltage over-shoot.
In some implementations, a frequency divider 110 is provided in the feedback path. Negative feedback forces the error signal output from the phase detector 102 to approach zero. At this point, the feedback divider output 110 and the reference frequency are in phase and frequency lock, i.e., aligned, the PLL is considered locked.
PLL circuits are often used in integrated processors and microcontrollers to provide an internal system clock. An external or internal clock determining component, such as a crystal or an RC (resistor-capacitor) component may be used. The crystal may have a relatively low oscillation frequency and the PLL circuit is used to multiply this base frequency to multiples of the base frequency for providing an internal high frequency system clock. However, PLL circuits are not immediately stable when a circuit is powered on.
In some applications, it is desirable to know when the PLL is locked on (stable). According to conventional lock-on detectors, a PLL is determined to be locked on via the use of counters, one on the input clock and one on the feedback clock, and checking that both the counters have the same count. However, missing by one count is a very relaxed criterion for lock-on in many situations; the desired lock is much tighter than that.